.codeBlockWrapper {
  position: relative;
  margin: 16px 0;
}

.codeBlock {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  transition: all 0.2s ease;
}

.codeBlock:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.codeBlock code {
  padding: 0;
  background-color: transparent;
  color: var(--text-primary);
  font-size: 0.875em;
  line-height: 1.6;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, 'Courier New', monospace;
  display: block;
  white-space: pre;
  word-wrap: normal;
}

/* 语言标识 */
.codeBlock::before {
  content: attr(data-language);
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.75em;
  font-weight: 500;
  color: var(--text-tertiary);
  background-color: rgba(255, 255, 255, 0.8);
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}

/* 复制按钮 */
.copyButton {
  position: absolute;
  top: 8px;
  right: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75em;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
}

.codeBlock:hover .copyButton {
  opacity: 1;
}

.copyButton:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: scale(1.05);
}

/* 滚动条样式 */
.codeBlock::-webkit-scrollbar {
  height: 6px;
}

.codeBlock::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.codeBlock::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.codeBlock::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .codeBlock {
    padding: 16px;
    font-size: 0.8em;
  }
  
  .copyButton {
    right: 8px;
    top: 6px;
  }
  
  .codeBlock::before {
    right: 8px;
    top: 6px;
    font-size: 0.7em;
  }
} 